package com.qiwenshare.fund.controller;

import com.qiwenshare.fund.model.FundInfo;
import com.qiwenshare.fund.service.impl.FundInfoService;
import com.qiwenshare.fund.util.FundDataUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName FundInfoController
 * @Description TODO
 * @Author peng.zhang
 * @Date 17:03 2023/6/12
 * @Version 1.0
 **/
@RestController
@RequestMapping("fund")
public class FundInfoController {
    @Resource
    private FundInfoService fundInfoService;

    @GetMapping("updateFund")
    public Object updateFund() {
        List<FundInfo> list = FundDataUtil.getFoundList();
        fundInfoService.saveBatch(list);
        return "ok";
    }
}
